//Cal.java
package com.xyc.ch7;
public class Cal{

   public static void main(String[] args)  {
	   int i,j;
	   int result=0;
	   char c;
//	   c=args[1].charAt(0);
//	   System.out.print(c);
	   if(args.length!=3)
	   {
		   System.out.println("Usage:java Cal operand1 operator operand2");
		   System.exit(0);
	   }
	   i=Integer.parseInt(args[0]);
	   j=Integer.parseInt(args[2]);
	   c=args[1].charAt(0);
	   switch(c)
	   {
	   case'+':result=i+j;
			   break;
	   case'-':result=i-j;
			   break;
	   case'乘':result=i*j;
			   break;
	   case'/':result=i/j;
			   break;
	   default:
			   System.out.println("运算符错误！");
			   System.exit(0);
	   }
	   System.out.println(args[0]+args[1]+args[2]+"="+result);
   }
}




